;;;Delete LWpolylines with only two coincident vertices (point polylines).
;;;Explodes all other two vertex LWpolylines to make them Lines.
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;     http://paracadd.com
;;;	All rights reserved.
;;;
(defun c:delptpl ()
  (setq plss (ssget "x" '((0 . "LWPOLYLINE")(90 . 2))))
  (setq plss_len (sslength plss))
  (princ (strcat "\n" (itoa plss_len) " LWpolylines with only 2 vertices found.\n"))
  (princ)
  (setq cnt 0
        delcnt 0
  )
  (while (< cnt plss_len)
    (setq plent (entget (ssname plss cnt)))
    (if (equal (assoc 10 plent)(assoc 10 (reverse plent))0.01)
      (progn
        (setq delcnt (1+ delcnt))
        (entdel (cdr(assoc -1 plent)))
      )
    )
    (setq cnt (1+ cnt))
  )
  (if ukword NIL (LOAD "ukword" "\nFile UKWORD.LSP not loaded! "))
  (Setq lwptoline (ukword 1 "Yes No" "Convert remaining 2-vertex LWpolylines into Lines?" (if lwptoline lwptoline "No")))
  (IF (eq lwptoline "Yes")
    (PROGN
      (command ".explode" plss)
      (princ (strcat "\n" (itoa delcnt) " LWpolylines with only 2 coincident vertices (point polylines) were deleted. "))
    )
  )
  (princ)
)